package lib
import (
	//"github.com/astaxie/beego/validation"
	//"strings"
)


type User struct {
	Id          uint64
	Tel         string
	Passwd      string

}

type Base struct {
	Id 			uint64
	Position    string
	LiquidLevel int16

}

//type DeviceConnController struct {
//	UdpPort     uint8
//}

type ControllerCmd struct {
	UserID     uint64       `valid:"Required;Numeric"`
	RespCode   int16		`valid:"Required;Numeric"`
	OpCode     uint8		`valid:"Required;Numeric"`
	Msg        string		`valid:"Required"`
}

type TcpUdpStruct struct {
	RespCode   uint8		`valid:"Required;Numeric"`
	OpCode     uint8		`valid:"Required;Numeric"`
	Msg        string		`valid:"Required"`
}

type TcpUdpCmd struct {
	RespCode   uint8		`valid:"Required;Numeric"`
	OpCode     uint8		`valid:"Required;Numeric"`
	Msg        string		`valid:"Required"`
}


//func (u *ControllerCmd) Valid(v *validation.Validation) {
//	if strings.Index(u.Name, "admin") != -1 {
//		// 通过 SetError 设置 Name 的错误信息，HasErrors 将会返回 true
//		v.SetError("Name", "名称里不能含有 admin")
//	}
//}
